module.exports = function($scope, $state, $stateParams, $modalInstance, $resource,$modal,FileUploader,toaster, apply_id, flag){
  $scope.flag = flag;
  console.log(flag);
  $resource('/api/ac/ggc/touristFundsCapitalApplyService/getCapitalApplyInfo', {}, {}).
  save({'apply_id' : apply_id},function(res) {
      if (res.errcode !== 0) {
          toaster.error({title:"",body:res.errmsg});
          return;
      }
      console.log(res);
      $scope.info = res.data;
  })
  $scope.ok = function(){
    $resource('/api/ac/ggc/touristFundsRuleService/createRule', {}, {}).
    save($scope.info,function(res) {
        if (res.errcode !== 0) {
            toaster.error({title:"",body:res.errmsg});
            return;
        }
        console.log(res);
        toaster.success({title:"",body:"操作成功"});
        $modalInstance.close();
    })
  }
  $scope.cancel = function(){
    $modalInstance.close();
  }


};